<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改配件店档案')" />
    <th:block th:include="include :: bootstrap-fileinput-css"/>
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-partsStore-edit" th:object="${zsyhUserPartsstore}">
            <input name="id" th:field="*{id}" type="hidden">

            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">店铺门头：</label>
                        <div class="col-sm-8">
                            <p class="user-info-head"><img id="storeImage" class="img-thumbnail img-lg" th:src="(${#strings.isEmpty(zsyhUserPartsstore.storeImage)}) ? @{/img/default_agent.png} : @{${storeImage}}"></p>
                            <!--<input type="hidden" name="storeImage" th:field="*{storeImage}">
                            <div class="file-loading">
                                <input class="form-control file-upload" id="storeImage" name="file" type="file">
                            </div>-->
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">营业执照：</label>
                        <div class="col-sm-8">
                            <p class="user-info-head"><img id="storeLicense" class="img-thumbnail img-lg" th:src="(${#strings.isEmpty(zsyhUserPartsstore.storeLicense)}) ? @{/img/default_license.png} : @{${zsyhUserPartsstore.storeLicense}}"></p>
                            <!--<input type="hidden" name="storeLicense" th:field="*{storeLicense}">
                            <div class="file-loading">
                                <input class="form-control file-upload" id="storeLicense" name="file" type="file">
                            </div>-->
                        </div>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">店铺联系人：</label>
                        <div class="col-sm-8">
                            <p name="storePerson" style="border-width: 0px;padding:6px 4px;"  class="form-control">[[*{storePerson}]]</p>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">店铺手机号：</label>
                        <div class="col-sm-8">
                            <p name="storePhone" style="border-width: 0px;padding:6px 4px;"  class="form-control">[[*{storePhone}]]</p>
                        </div>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">店铺名称：</label>
                        <div class="col-sm-8">
                            <p name="storeName" style="border-width: 0px;padding:6px 4px;"  class="form-control">[[*{storeName}]]</p>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">服务承诺：</label>
                        <div class="col-sm-8">
                            <p name="storeService" style="border-width: 0px;padding:6px 4px;"  class="form-control">[[*{storeService}]]</p>
                        </div>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">店铺浏览量：</label>
                        <div class="col-sm-8">
                            <p name="storePageviews" style="border-width: 0px;padding:6px 4px;"  class="form-control">[[*{storePageviews}]]</p>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">营业时间：</label>
                        <div class="col-sm-8">
                            <p name="storeBusinessHours" style="border-width: 0px;padding:6px 4px;"  class="form-control">[[*{storeBusinessHours}]]</p>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">详细地址：</label>
                        <div class="col-sm-8">
                            <p name="storeAddress" style="border-width: 0px;padding:6px 4px;"  class="form-control">[[*{storeAddress}]]</p>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">开业年限：</label>
                        <div class="col-sm-8">
                            <p name="storeOpenYears" style="border-width: 0px;padding:6px 4px;"  class="form-control">[[*{storeOpenYears}]]</p>
                        </div>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">主营产品：</label>
                        <div class="col-sm-8">
                            <p name="storeContent" style="border-width: 0px;padding:6px 4px;"  class="form-control">[[*{storeContent}]]</p>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">状态：</label>
                        <div class="col-sm-8">
                            <p name="storeStateName" style="border-width: 0px;padding:6px 4px;"  class="form-control">[[*{storeStateName}]]</p>
                        </div>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">所属大区：</label>
                        <div class="col-sm-8">
                            <p name="agentName" style="border-width: 0px;padding:6px 4px;"  class="form-control">[[*{agentName}]]</p>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">是否订单管理权：</label>
                        <div class="col-sm-8">
                            <div class="radio-box" th:each="dict : ${@dict.getType('zsyh_yesno')}">
                                <input type="radio" th:id="${'isRaker_' + dict.dictCode}" name="isRaker" th:value="${dict.dictValue}" th:field="*{isRaker}" required>
                                <label th:for="${'isRaker_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="row" id="rejectReason">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-4 control-label">驳回原因：</label>
                        <div class="col-sm-8">
                            <p name="storeRejectReason" style="border-width: 0px;padding:6px 4px;"  class="form-control">[[*{storeRejectReason}]]</p>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: bootstrap-fileinput-js"/>
    <script th:inline="javascript">
        var prefix = ctx + "zsyh/partsStore";
        $("#form-partsStore-edit").validate({
            focusCleanup: true
        });

        $(".file-upload").each(function (i) {
            var val = $("input[name='" + this.id + "']").val()
            $(this).fileinput({
                'uploadUrl': ctx + 'common/uploadOSS',
                initialPreviewAsData: true,
                initialPreview: [val],
                maxFileCount: 1,
                autoReplace: true
            }).on('fileuploaded', function (event, data, previewId, index) {
                $("input[name='" + event.currentTarget.id + "']").val(data.response.url)
            }).on('fileremoved', function (event, id, index) {
                $("input[name='" + event.currentTarget.id + "']").val('')
            })
            $(this).fileinput('_initFileActions');
        });

        $(document).ready(function () {
            if([[${zsyhUserPartsstore.storeStateName}]] == '驳回'){
                $("#rejectReason").css("display","block");

            }else{
                $("#rejectReason").css("display","none");
            }
        })

    </script>
</body>
</html>